			// Class for each pole of a pattern
			var PatternPole = function(setPole,setX,setY,setStepToAngle,setSquareWidth,setSquareHeight,setColor,creator,setZIndex,setStepToX,setStepToY,setShiftX,setShiftY){
			this.creator = creator;
			this.pole = setPole;
			
			this.stepToAngle	= setStepToAngle;
			
			this.stepToX		= setStepToX;
			this.stepToY		= setStepToY;
			
			this.shiftX			= setShiftX;
			this.shiftY			= setShiftY;
			
			this.angle			= setStepToAngle*90;
			this.squareWidth	= setSquareWidth;
			this.squareHeight	= setSquareHeight;
			this.color			= setColor;
			this.size			= creator.size;
			this.zIndex			= setZIndex;

			this.x				= this.stepToX*(this.squareWidth*(this.size+1)+6)+this.shiftX;
			this.y				= this.stepToY*(this.squareHeight*(this.size+1)+6)+this.shiftY;

// setStepToX*setSquareWidth*this.size+this.shiftX;

				this.continueSet = false;
				this.tryContinue = function(){
				this.continueSet = true;
				}
				
				this.rotate = function(direction){
				this.stepToAngle+=direction;
				this.rotationDirection = direction;
					// Rotationstep should not be over 3 or under 0
					if(this.stepToAngle>3)
					{this.stepToAngle=0;}
					if(this.stepToAngle<0)
					{this.stepToAngle=3;}
				};

				this.printColor = function(){
				return ("rgb("+this.color[0]+","+this.color[1]+","+this.color[2]+")");
				}			
				if(this.pole === "negative")
				{
					this.draw = function(context, rotate, moveX, moveY){
					eval(this.creator.drawCode);
					};
				}
				else if(this.pole === "positive")
				{
					this.draw = function(context, rotate, moveX, moveY){
					eval(this.creator.drawCode2)
					};
				}
			}